import config from "@/config"
import http from "@/utils/request"
import { objectToFormData } from "@/utils/formDataFormat";

export default {
    APITestList: {
        url: `${config.API_URL}/api_1_0/test/query`,
        name: "检测结果查询接口",
        http: async function(data = {}) {
            return await http.get(this.url, data);
        }
    },
    APITestDelete: {
        url: `${config.API_URL}/api_1_0/test/delete`,
        name: "检测结果删除接口",
        http: async function(data = {}) {
            return await http.post(this.url, objectToFormData(data));
        }
    },
    APITestUpload: {
        url: `${config.API_URL}/api_1_0/test/get_excel`,
        name: "导出excel接口",
        http: async function(data = {}) {
            return await http.post(this.url, objectToFormData(data));
        }
    },
    APITestUpdate: {
        url: `${config.API_URL}/api_1_0/test/update`,
        name: "修正异常接口",
        http: async function(data = {}) {
            return await http.post(this.url, objectToFormData(data));
        }
    },
    APITestUpdateRe: {
        url: `${config.API_URL}/api_1_0/test/result_update`,
        name: "检测结果异常修改接口",
        http: async function(data = {}) {
            return await http.post(this.url, objectToFormData(data));
        }
    },
    APIUnsubmit: {
        url: `${config.API_URL}/api_1_0/testinfo/unsubmit`,
        name: "未提交查询接口",
        http: async function(data = {}) {
            return await http.get(this.url, data);
        }
    },
}